x86: com devices's irqaction shouldn't free.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Sep 2009 06:37:27 +0000 (07:37 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Sep 2009 06:37:27 +0000 (07:37 +0100)
Since irqs of serial devices are initialized in early Xen and
its irqaction is not allocated from heap, so doesn't need free
in release irq logic.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/irq.c
xen/include/xen/irq.h

index e547a7b9c8aa196e5a7221a81074ffca3eca8f4e..eabce3b3e15cc061ac5bcbaa65269dcb62df5a33 100644 (file)
@@ -537,6 +537,7 @@ int request_irq(unsigned int irq,
     action->handler = handler;
     action->name = devname;
     action->dev_id = dev_id;
+    action->free_on_release = 1;
 
     retval = setup_irq(irq, action);
     if (retval)
@@ -564,7 +565,7 @@ void release_irq(unsigned int irq)
     /* Wait to make sure it's not being used on another CPU */
     do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
 
-    if (action)
+    if (action && action->free_on_release)
         xfree(action);
 }
 
index b16d62e90ccde537bf54da75bb4c84db96e248f1..58bf9f05358b388200e2f21feb3a09c5a9d99191 100644 (file)
@@ -7,11 +7,11 @@
 #include <asm/regs.h>
 #include <asm/hardirq.h>
 
-struct irqaction
-{
+struct irqaction {
     void (*handler)(int, void *, struct cpu_user_regs *);
     const char *name;
     void *dev_id;
+    bool_t free_on_release;
 };
 
 /*
@@ -63,10 +63,8 @@ struct irq_cfg;
  * This is the "IRQ descriptor", which contains various information
  * about the irq, including what kind of hardware handling it has,
  * whether it is disabled etc etc.
- *
- * Pad this out to 32 bytes for cache and indexing reasons.
  */
-typedef struct irq_desc{
+typedef struct irq_desc {
     unsigned int status;               /* IRQ status */
     hw_irq_controller *handler;
     struct msi_desc   *msi_desc;